Welcome to the airquality package. This package uses various data from the .
It includes various functions that help you to get an overview about the airquality in any town. You can:
In the following, each function is explained in detail and examples are provided.
#github_install can only be added when the week 3 branch is merged
#install_github('Programming-The-Next-Step-2022/airquality')
This function takes the city and country (use ISO 3166 country codes) of interest as arguments. It outputs a data frame containing the:
current_aq_df("Amsterdam", "NL")
## Component Index / Concentration
## 1 AQI 2.00
## 2 CO 350.48
## 3 NO 58.12
## 4 NO2 56.21
## 5 O3 0.00
## 6 SO2 3.58
## 7 PM2_5 4.41
## 8 PM_10 6.43
## 9 NH3 14.06
To display the output to users in a nicer way, you can use the gt::gt() function
gt(current_aq_df())
| Component | Index / Concentration |
|---|---|
| AQI | 2.00 |
| CO | 350.48 |
| NO | 58.12 |
| NO2 | 56.21 |
| O3 | 0.00 |
| SO2 | 3.58 |
| PM2_5 | 4.41 |
| PM_10 | 6.43 |
| NH3 | 14.06 |
This function takes the city and country (use ISO 3166 country codes) of interest as arguments. It outputs a plot showing the average AQI per day over the last two weeks.
plot_aqi_hist("Paris", "FRA")
This function takes the city, the country (use ISO 3166 country codes), and the desired subcomponent (e.g., co) as arguments. It outputs a plot showing the average concentration of for example carbon monoxide over the last two weeks.
plot_comp_hist("Rome", "ITA", "co")
This function shows the current AQI in the ten largest European cities. The values are colored according the AQI.
current_aq_table()
| Current Airquality Index (AQI) of Top 10 Major Europan Cities | |
|---|---|
| Cities | AQI |
| Istanbul | 5 |
| London | 1 |
| Berlin | 1 |
| Madrid | 1 |
| Kyiv | 1 |
| Rome | 2 |
| Bucharest | 2 |
| Paris | 1 |
| Vienna | 1 |
| Hamburg | 1 |
This function takes the city and country (use ISO 3166 country codes) of interest as arguments. It outputs a data frame containing the:
current_weather("Berlin", "GER")
| Component | Data |
|---|---|
| Current Weather | few clouds |
| Current Temperature | 10.45 |
| Feels Like Temperature | 9.61 |
| Min Temperature | 6.75 |
| Max Temperature | 12.2 |
| Air Pressure | 1013 |
| Humidity | 79 |
| Visibility | 10000 |
| Wind Speed | 4.47 |
| Wind Direction | 260 |
| Sunrise | DE |
| Sunset | 1653879104 |